<%@ page import="org.jackysoft.util.*" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib  uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib  uri="http://www.springframework.org/security/tags" prefix="sec" %>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib  uri="http://www.joda.org/joda/time/tags" prefix="joda" %>
<c:set var="ptn" value="######0.0000" />
<table class="table table-hover table-bordered table-striped table-condensed ">
<caption class="label label-inverse">合同明细列表</caption>
<thead> 
  <tr>
    <th>产品代码[名称]</th>
    <th>合同号</th>
    <th>客户</th>
    <th>配套类型</th>
    <th>验收状态</th>
    <th>行业类型</th>
    <th>生产单位</th>
    <th>备注</th>   
  </tr>
</thead>
<tbody>
  <c:forEach items="${pager.rows}" var="item">
   
   <tr class="info">
    <td>     
     <span class="label label-info">
       ${item.code}
     </span>[${item.pdtName}]
     
    </td>
    <td>
      ${item.ctName}
    </td>
    <td>
     ${item.cName}
    </td>   
    <td>
       ${item.contracttype}
    </td>
    <td>
       ${item.validation}
    </td>
    <td>
       ${item.tradetype}
    </td>
    <td>
       ${item.deptName}
    </td>
    <td>
       ${item.remark}
    </td>
   
   </tr>  
   <%
      Months[] ms = Months.values();
      pageContext.setAttribute("months", ms);
      //Weeks[] ws = Weeks.values();
   %>
  
   <tr class="info">
    
    <td colspan="10" id="${item.id}_panel"> 
     <table class="table table-condensed">
         <thead>
         <tr> 
          <c:forEach items="${months}" var="m">
            <th>
            <span class="${item[m.name]==0?'':'label label-important'}">
            ${m.label}月
            </span>
            </th>         
          </c:forEach>         
         </tr>  
         </thead>
         <tbody>
           <tr>
              <c:forEach items="${months}" var="m">
            <td>
             <span >
                ${item[m.name]}
             </span>             
            </td>         
          </c:forEach> 
           </tr>
           <tr>
             <th colspan="3">            
             <span class="${item.q1>0?'label label-important':''}">一季度</span>                    
                                         
            </th>
             <th colspan="3">            
             <span class="${item.q2>0?'label label-important':''}">二季度</span>                    
                                         
            </th>
             <th colspan="3">            
             <span class="${item.q3>0?'label label-important':''}">三季度</span>                    
                                         
            </th>
             <th colspan="3">            
             <span class="${item.q4>0?'label label-important':''}">四季度</span>                    
                                         
            </th>             
           </tr>
           <tr>
             <th colspan="3">
             <span class="${item.q1>0?'label label-important':''}">
             <fmt:formatNumber value="${item.q1}" pattern="${ptn}" />
             </span> 
             </th>
             <th colspan="3">
             <span class="${item.q2>0?'label label-important':''}">
              <fmt:formatNumber value="${item.q2}" pattern="${ptn}" />
             </span> 
             </th>
             <th colspan="3">
             <span class="${item.q3>0?'label label-important':''}">
               <fmt:formatNumber value="${item.q3}" pattern="${ptn}" />
              
             </span> 
             </th>
             <th colspan="3">
             <span class="${item.q4>0?'label label-important':''}">
              <fmt:formatNumber value="${item.q4}" pattern="${ptn}" />
             
             </span> 
             </th>             
           </tr>
         </tbody>     
     </table>
   
    </td>
    
   </tr>
  </c:forEach>
</tbody>
<tfoot>
 <th colspan="9">
  ${pager.pagination}
 </th>
</tfoot>
</table>

<script type="text/javascript" src="scripts/apps/contract/details.js"></script>